import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { loungeFacilityVO, loungeFacilityForm, loungeFacilityQuery } from '@/api/lounge/lounge-facility/types';

/**
 * 查询休息室-设施列表
 * @param query
 * @returns {*}
 */

export const listloungeFacility = (query?: loungeFacilityQuery): AxiosPromise<loungeFacilityVO[]> => {
  return request({
    url: '/lounge/lounge-facility/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询休息室-设施详细
 * @param loungeFacilityId
 */
export const getloungeFacility = (loungeFacilityId: string | number): AxiosPromise<loungeFacilityVO> => {
  return request({
    url: '/lounge/lounge-facility/' + loungeFacilityId,
    method: 'get'
  });
};

/**
 * 新增休息室-设施
 * @param data
 */
export const addloungeFacility = (data: loungeFacilityForm) => {
  return request({
    url: '/lounge/lounge-facility',
    method: 'post',
    data: data
  });
};

/**
 * 修改休息室-设施
 * @param data
 */
export const updateloungeFacility = (data: loungeFacilityForm) => {
  return request({
    url: '/lounge/lounge-facility',
    method: 'put',
    data: data
  });
};

/**
 * 删除休息室-设施
 * @param loungeFacilityId
 */
export const delloungeFacility = (loungeFacilityId: string | number | Array<string | number>) => {
  return request({
    url: '/lounge/lounge-facility/' + loungeFacilityId,
    method: 'delete'
  });
};
